import os
Debug = 1
#遍历当前目录下面的，所有子目录里的文件，文件名为VersionInfo.h时，就设置属性值。
def SetProperies(p_dir):
	if(not os.path.isdir(p_dir)):
		return
	for cur_file in os.listdir(p_dir):
		subpath = os.path.join(p_dir,cur_file)
		if(os.path.isfile(subpath)):
			if(cur_file == "VersionInfo.h"):
				outstr = os.popen("svn ps svn:keywords \"Author Id Date URL Revision Header\" " + subpath).read()
				if(Debug==1):
					print(outstr)
					getinfo = os.popen("svn pl " + subpath +" -v --xml").read()
					print(getinfo)
		if(os.path.isdir(subpath)):
			SetProperies(subpath)
	return 
if __name__ == "__main__":
	SetProperies(os.getcwd())
	if(Debug ==1):
		os.system("pause")